Optimal. Leaf size=129 \[ -\frac {(b+2 c x) \sqrt {a+b x+c x^2}}{(a-d) \left (b^2-4 c d\right ) \left (d+b x+c x^2\right )}+\frac {\left (b^2+4 c (a-2 d)\right ) \tanh ^{-1}\left (\frac {\sqrt {a-d} (b+2 c x)}{\sqrt {b^2-4 c d} \sqrt {a+b x+c x^2}}\right )}{(a-d)^{3/2} \left (b^2-4 c d\right )^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 129, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {988, 12, 996,
214} \begin {gather*} \frac {\left (4 c (a-2 d)+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a-d} (b+2 c x)}{\sqrt {b^2-4 c d} \sqrt {a+b x+c x^2}}\right )}{(a-d)^{3/2} \left (b^2-4 c d\right )^{3/2}}-\frac {(b+2 c x) \sqrt {a+b x+c x^2}}{(a-d) \left (b^2-4 c d\right ) \left (b x+c x^2+d\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 214
Rule 988
Rule 996
Rubi steps
\begin {align*} \int \frac {1}{\sqrt {a+b x+c x^2} \left (d+b x+c x^2\right )^2} \, dx &=-\frac {(b+2 c x) \sqrt {a+b x+c x^2}}{(a-d) \left (b^2-4 c d\right ) \left (d+b x+c x^2\right )}+\frac {\int -\frac {c^2 \left (b^2+4 c (a-2 d)\right ) (a-d)}{2 \sqrt {a+b x+c x^2} \left (d+b x+c x^2\right )} \, dx}{c^2 (a-d)^2 \left (b^2-4 c d\right )}\\ &=-\frac {(b+2 c x) \sqrt {a+b x+c x^2}}{(a-d) \left (b^2-4 c d\right ) \left (d+b x+c x^2\right )}-\frac {\left (b^2+4 c (a-2 d)\right ) \int \frac {1}{\sqrt {a+b x+c x^2} \left (d+b x+c x^2\right )} \, dx}{2 (a-d) \left (b^2-4 c d\right )}\\ &=-\frac {(b+2 c x) \sqrt {a+b x+c x^2}}{(a-d) \left (b^2-4 c d\right ) \left (d+b x+c x^2\right )}+\frac {\left (b \left (b^2+4 c (a-2 d)\right )\right ) \text {Subst}\left (\int \frac {1}{b \left (b^2-4 c d\right )-(a b-b d) x^2} \, dx,x,\frac {b+2 c x}{\sqrt {a+b x+c x^2}}\right )}{(a-d) \left (b^2-4 c d\right )}\\ &=-\frac {(b+2 c x) \sqrt {a+b x+c x^2}}{(a-d) \left (b^2-4 c d\right ) \left (d+b x+c x^2\right )}+\frac {\left (b^2+4 c (a-2 d)\right ) \tanh ^{-1}\left (\frac {\sqrt {a-d} (b+2 c x)}{\sqrt {b^2-4 c d} \sqrt {a+b x+c x^2}}\right )}{(a-d)^{3/2} \left (b^2-4 c d\right )^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in
optimal.
time = 0.69, size = 215, normalized size = 1.67 \begin {gather*} \frac {\frac {2 (b+2 c x) \sqrt {a+x (b+c x)}}{d+x (b+c x)}+\left (b^2+4 c (a-2 d)\right ) \text {RootSum}\left [-a b^2+a^2 c+b^2 d+2 a b \sqrt {c} \text {$\#$1}-4 b \sqrt {c} d \text {$\#$1}+b^2 \text {$\#$1}^2-2 a c \text {$\#$1}^2+4 c d \text {$\#$1}^2-2 b \sqrt {c} \text {$\#$1}^3+c \text {$\#$1}^4\&,\frac {\log \left (-\sqrt {c} x+\sqrt {a+b x+c x^2}-\text {$\#$1}\right )}{a \sqrt {c}-2 \sqrt {c} d+b \text {$\#$1}-\sqrt {c} \text {$\#$1}^2}\&\right ]}{2 (a-d) \left (-b^2+4 c d\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(826\) vs.
\(2(117)=234\).
time = 0.17, size = 827, normalized size = 6.41
method | result | size |
default | \(-\frac {2 c \ln \left (\frac {2 a -2 d -\sqrt {b^{2}-4 c d}\, \left (x +\frac {b +\sqrt {b^{2}-4 c d}}{2 c}\right )+2 \sqrt {a -d}\, \sqrt {\left (x +\frac {b +\sqrt {b^{2}-4 c d}}{2 c}\right )^{2} c -\sqrt {b^{2}-4 c d}\, \left (x +\frac {b +\sqrt {b^{2}-4 c d}}{2 c}\right )+a -d}}{x +\frac {b +\sqrt {b^{2}-4 c d}}{2 c}}\right )}{\left (b^{2}-4 c d \right )^{\frac {3}{2}} \sqrt {a -d}}+\frac {-\frac {\sqrt {\left (x -\frac {-b +\sqrt {b^{2}-4 c d}}{2 c}\right )^{2} c +\sqrt {b^{2}-4 c d}\, \left (x -\frac {-b +\sqrt {b^{2}-4 c d}}{2 c}\right )+a -d}}{\left (a -d \right ) \left (x -\frac {-b +\sqrt {b^{2}-4 c d}}{2 c}\right )}+\frac {\sqrt {b^{2}-4 c d}\, \ln \left (\frac {2 a -2 d +\sqrt {b^{2}-4 c d}\, \left (x -\frac {-b +\sqrt {b^{2}-4 c d}}{2 c}\right )+2 \sqrt {a -d}\, \sqrt {\left (x -\frac {-b +\sqrt {b^{2}-4 c d}}{2 c}\right )^{2} c +\sqrt {b^{2}-4 c d}\, \left (x -\frac {-b +\sqrt {b^{2}-4 c d}}{2 c}\right )+a -d}}{x -\frac {-b +\sqrt {b^{2}-4 c d}}{2 c}}\right )}{2 \left (a -d \right )^{\frac {3}{2}}}}{b^{2}-4 c d}+\frac {2 c \ln \left (\frac {2 a -2 d +\sqrt {b^{2}-4 c d}\, \left (x -\frac {-b +\sqrt {b^{2}-4 c d}}{2 c}\right )+2 \sqrt {a -d}\, \sqrt {\left (x -\frac {-b +\sqrt {b^{2}-4 c d}}{2 c}\right )^{2} c +\sqrt {b^{2}-4 c d}\, \left (x -\frac {-b +\sqrt {b^{2}-4 c d}}{2 c}\right )+a -d}}{x -\frac {-b +\sqrt {b^{2}-4 c d}}{2 c}}\right )}{\left (b^{2}-4 c d \right )^{\frac {3}{2}} \sqrt {a -d}}+\frac {-\frac {\sqrt {\left (x +\frac {b +\sqrt {b^{2}-4 c d}}{2 c}\right )^{2} c -\sqrt {b^{2}-4 c d}\, \left (x +\frac {b +\sqrt {b^{2}-4 c d}}{2 c}\right )+a -d}}{\left (a -d \right ) \left (x +\frac {b +\sqrt {b^{2}-4 c d}}{2 c}\right )}-\frac {\sqrt {b^{2}-4 c d}\, \ln \left (\frac {2 a -2 d -\sqrt {b^{2}-4 c d}\, \left (x +\frac {b +\sqrt {b^{2}-4 c d}}{2 c}\right )+2 \sqrt {a -d}\, \sqrt {\left (x +\frac {b +\sqrt {b^{2}-4 c d}}{2 c}\right )^{2} c -\sqrt {b^{2}-4 c d}\, \left (x +\frac {b +\sqrt {b^{2}-4 c d}}{2 c}\right )+a -d}}{x +\frac {b +\sqrt {b^{2}-4 c d}}{2 c}}\right )}{2 \left (a -d \right )^{\frac {3}{2}}}}{b^{2}-4 c d}\) | \(827\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 667 vs.
\(2 (117) = 234\).
time = 3.59, size = 1544, normalized size = 11.97 \begin {gather*} \left [\frac {\sqrt {a b^{2} + 4 \, c d^{2} - {\left (b^{2} + 4 \, a c\right )} d} {\left (8 \, c d^{2} - {\left (b^{2} c + 4 \, a c^{2} - 8 \, c^{2} d\right )} x^{2} - {\left (b^{2} + 4 \, a c\right )} d - {\left (b^{3} + 4 \, a b c - 8 \, b c d\right )} x\right )} \log \left (\frac {8 \, a^{2} b^{4} + {\left (b^{4} c^{2} + 24 \, a b^{2} c^{3} + 16 \, a^{2} c^{4} + 128 \, c^{4} d^{2} - 32 \, {\left (b^{2} c^{3} + 4 \, a c^{4}\right )} d\right )} x^{4} + 2 \, {\left (b^{5} c + 24 \, a b^{3} c^{2} + 16 \, a^{2} b c^{3} + 128 \, b c^{3} d^{2} - 32 \, {\left (b^{3} c^{2} + 4 \, a b c^{3}\right )} d\right )} x^{3} + {\left (b^{4} + 24 \, a b^{2} c + 16 \, a^{2} c^{2}\right )} d^{2} + {\left (b^{6} + 32 \, a b^{4} c + 48 \, a^{2} b^{2} c^{2} + 32 \, {\left (5 \, b^{2} c^{2} + 4 \, a c^{3}\right )} d^{2} - 2 \, {\left (19 \, b^{4} c + 104 \, a b^{2} c^{2} + 48 \, a^{2} c^{3}\right )} d\right )} x^{2} - 4 \, {\left (2 \, a b^{3} + 2 \, {\left (b^{2} c^{2} + 4 \, a c^{3} - 8 \, c^{3} d\right )} x^{3} + 3 \, {\left (b^{3} c + 4 \, a b c^{2} - 8 \, b c^{2} d\right )} x^{2} - {\left (b^{3} + 4 \, a b c\right )} d + {\left (b^{4} + 8 \, a b^{2} c - 2 \, {\left (5 \, b^{2} c + 4 \, a c^{2}\right )} d\right )} x\right )} \sqrt {a b^{2} + 4 \, c d^{2} - {\left (b^{2} + 4 \, a c\right )} d} \sqrt {c x^{2} + b x + a} - 8 \, {\left (a b^{4} + 4 \, a^{2} b^{2} c\right )} d + 2 \, {\left (4 \, a b^{5} + 16 \, a^{2} b^{3} c + 16 \, {\left (b^{3} c + 4 \, a b c^{2}\right )} d^{2} - {\left (3 \, b^{5} + 40 \, a b^{3} c + 48 \, a^{2} b c^{2}\right )} d\right )} x}{c^{2} x^{4} + 2 \, b c x^{3} + 2 \, b d x + {\left (b^{2} + 2 \, c d\right )} x^{2} + d^{2}}\right ) - 4 \, {\left (a b^{3} + 4 \, b c d^{2} - {\left (b^{3} + 4 \, a b c\right )} d + 2 \, {\left (a b^{2} c + 4 \, c^{2} d^{2} - {\left (b^{2} c + 4 \, a c^{2}\right )} d\right )} x\right )} \sqrt {c x^{2} + b x + a}}{4 \, {\left (a^{2} b^{4} d + 16 \, c^{2} d^{5} - 8 \, {\left (b^{2} c + 4 \, a c^{2}\right )} d^{4} + {\left (b^{4} + 16 \, a b^{2} c + 16 \, a^{2} c^{2}\right )} d^{3} - 2 \, {\left (a b^{4} + 4 \, a^{2} b^{2} c\right )} d^{2} + {\left (a^{2} b^{4} c + 16 \, c^{3} d^{4} - 8 \, {\left (b^{2} c^{2} + 4 \, a c^{3}\right )} d^{3} + {\left (b^{4} c + 16 \, a b^{2} c^{2} + 16 \, a^{2} c^{3}\right )} d^{2} - 2 \, {\left (a b^{4} c + 4 \, a^{2} b^{2} c^{2}\right )} d\right )} x^{2} + {\left (a^{2} b^{5} + 16 \, b c^{2} d^{4} - 8 \, {\left (b^{3} c + 4 \, a b c^{2}\right )} d^{3} + {\left (b^{5} + 16 \, a b^{3} c + 16 \, a^{2} b c^{2}\right )} d^{2} - 2 \, {\left (a b^{5} + 4 \, a^{2} b^{3} c\right )} d\right )} x\right )}}, -\frac {\sqrt {-a b^{2} - 4 \, c d^{2} + {\left (b^{2} + 4 \, a c\right )} d} {\left (8 \, c d^{2} - {\left (b^{2} c + 4 \, a c^{2} - 8 \, c^{2} d\right )} x^{2} - {\left (b^{2} + 4 \, a c\right )} d - {\left (b^{3} + 4 \, a b c - 8 \, b c d\right )} x\right )} \arctan \left (-\frac {{\left (2 \, a b^{2} + {\left (b^{2} c + 4 \, a c^{2} - 8 \, c^{2} d\right )} x^{2} - {\left (b^{2} + 4 \, a c\right )} d + {\left (b^{3} + 4 \, a b c - 8 \, b c d\right )} x\right )} \sqrt {-a b^{2} - 4 \, c d^{2} + {\left (b^{2} + 4 \, a c\right )} d} \sqrt {c x^{2} + b x + a}}{2 \, {\left (a^{2} b^{3} + 4 \, a b c d^{2} + 2 \, {\left (a b^{2} c^{2} + 4 \, c^{3} d^{2} - {\left (b^{2} c^{2} + 4 \, a c^{3}\right )} d\right )} x^{3} + 3 \, {\left (a b^{3} c + 4 \, b c^{2} d^{2} - {\left (b^{3} c + 4 \, a b c^{2}\right )} d\right )} x^{2} - {\left (a b^{3} + 4 \, a^{2} b c\right )} d + {\left (a b^{4} + 2 \, a^{2} b^{2} c + 4 \, {\left (b^{2} c + 2 \, a c^{2}\right )} d^{2} - {\left (b^{4} + 6 \, a b^{2} c + 8 \, a^{2} c^{2}\right )} d\right )} x\right )}}\right ) + 2 \, {\left (a b^{3} + 4 \, b c d^{2} - {\left (b^{3} + 4 \, a b c\right )} d + 2 \, {\left (a b^{2} c + 4 \, c^{2} d^{2} - {\left (b^{2} c + 4 \, a c^{2}\right )} d\right )} x\right )} \sqrt {c x^{2} + b x + a}}{2 \, {\left (a^{2} b^{4} d + 16 \, c^{2} d^{5} - 8 \, {\left (b^{2} c + 4 \, a c^{2}\right )} d^{4} + {\left (b^{4} + 16 \, a b^{2} c + 16 \, a^{2} c^{2}\right )} d^{3} - 2 \, {\left (a b^{4} + 4 \, a^{2} b^{2} c\right )} d^{2} + {\left (a^{2} b^{4} c + 16 \, c^{3} d^{4} - 8 \, {\left (b^{2} c^{2} + 4 \, a c^{3}\right )} d^{3} + {\left (b^{4} c + 16 \, a b^{2} c^{2} + 16 \, a^{2} c^{3}\right )} d^{2} - 2 \, {\left (a b^{4} c + 4 \, a^{2} b^{2} c^{2}\right )} d\right )} x^{2} + {\left (a^{2} b^{5} + 16 \, b c^{2} d^{4} - 8 \, {\left (b^{3} c + 4 \, a b c^{2}\right )} d^{3} + {\left (b^{5} + 16 \, a b^{3} c + 16 \, a^{2} b c^{2}\right )} d^{2} - 2 \, {\left (a b^{5} + 4 \, a^{2} b^{3} c\right )} d\right )} x\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\sqrt {a + b x + c x^{2}} \left (b x + c x^{2} + d\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1166 vs.
\(2 (117) = 234\).
time = 5.01, size = 1166, normalized size = 9.04 \begin {gather*} -\frac {\frac {{\left (b^{2} + 4 \, a c - 8 \, c d\right )} \log \left ({\left | {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} b^{2} c + 4 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} a c^{2} - 8 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} c^{2} d + {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} b^{3} \sqrt {c} + 4 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} a b c^{\frac {3}{2}} - 8 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} b c^{\frac {3}{2}} d + 3 \, a b^{2} c + 4 \, \sqrt {a b^{2} - b^{2} d - 4 \, a c d + 4 \, c d^{2}} {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} c^{\frac {3}{2}} - 4 \, a^{2} c^{2} - 2 \, b^{2} c d + 4 \, \sqrt {a b^{2} - b^{2} d - 4 \, a c d + 4 \, c d^{2}} {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} b c + \sqrt {a b^{2} - b^{2} d - 4 \, a c d + 4 \, c d^{2}} b^{2} \sqrt {c} \right |}\right )}{\sqrt {a b^{2} - b^{2} d - 4 \, a c d + 4 \, c d^{2}}} - \frac {{\left (b^{2} + 4 \, a c - 8 \, c d\right )} \log \left ({\left | {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} b^{2} c + 4 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} a c^{2} - 8 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} c^{2} d + {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} b^{3} \sqrt {c} + 4 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} a b c^{\frac {3}{2}} - 8 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} b c^{\frac {3}{2}} d + 3 \, a b^{2} c - 4 \, \sqrt {a b^{2} - b^{2} d - 4 \, a c d + 4 \, c d^{2}} {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} c^{\frac {3}{2}} - 4 \, a^{2} c^{2} - 2 \, b^{2} c d - 4 \, \sqrt {a b^{2} - b^{2} d - 4 \, a c d + 4 \, c d^{2}} {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} b c - \sqrt {a b^{2} - b^{2} d - 4 \, a c d + 4 \, c d^{2}} b^{2} \sqrt {c} \right |}\right )}{\sqrt {a b^{2} - b^{2} d - 4 \, a c d + 4 \, c d^{2}}}}{2 \, {\left (a b^{2} - b^{2} d - 4 \, a c d + 4 \, c d^{2}\right )}} + \frac {{\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} b^{2} \sqrt {c} + 4 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} a c^{\frac {3}{2}} - 8 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} c^{\frac {3}{2}} d + {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} b^{3} + 4 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} a b c - 8 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} b c d + 3 \, a b^{2} \sqrt {c} - 4 \, a^{2} c^{\frac {3}{2}} - 2 \, b^{2} \sqrt {c} d}{{\left ({\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{4} c + 2 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{3} b \sqrt {c} + {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} b^{2} - 2 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} a c + 4 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )}^{2} c d - 2 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} a b \sqrt {c} + 4 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} b \sqrt {c} d - a b^{2} + a^{2} c + b^{2} d\right )} {\left (a b^{2} - b^{2} d - 4 \, a c d + 4 \, c d^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {1}{\sqrt {c\,x^2+b\,x+a}\,{\left (c\,x^2+b\,x+d\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________